﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using QLNHang.DTO;
using QuanLyDatVe.DataAccessLayer;

namespace QLNHang.DAO
{
    class ChiTietThucDonDAO
    {
        private ConnectDatabase cn = new ConnectDatabase();
        public void ThemChiTietThucDon(ChiTietThucDonDTO cttdDto)
        {
            cn.OpenDatabase();
            SqlCommand cmd = new SqlCommand("sp_ThemChiTietThucDon", cn.SqlConnect);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@maThucDon", SqlDbType.Int).Value = cttdDto.MaThucDon;
            cmd.Parameters.Add("@maMonAn", SqlDbType.Int).Value = cttdDto.MaMonAn;
            cmd.Parameters.Add("@soLuongKhauPhan", SqlDbType.Int).Value = cttdDto.SoKhauPhan;
            cmd.ExecuteNonQuery();
            cn.CloseDatabase();
        }
    }
}
